package com.nokia.hag;

import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;

public class InputReader extends Thread {
	
	private InputStream stream;
	private StringWriter writer;
	
	public InputReader(InputStream input) {
		this.stream = input;
		this.writer = new StringWriter();
	}

	public void run() {
		try {
			int chr;
			while ((chr = this.stream.read()) != -1) {
				this.writer.write(chr);
			}
		} catch(IOException ex) { }
	}
	
	public String getResult()
	{
		return this.writer.toString();
	}
}
